﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TemplateWizard;
using System.IO;

namespace SecurableWebFormWizard
{
    public class SecurableWebFormWizard : IWizard
    {
        string solutionPath = string.Empty;
        string projectPath = string.Empty;

        public void BeforeOpeningFile(EnvDTE.ProjectItem projectItem)
        {
            
        }

        public void ProjectFinishedGenerating(EnvDTE.Project project)
        {
            
        }

        public void ProjectItemFinishedGenerating(EnvDTE.ProjectItem projectItem)
        {
            
        }

        public void RunFinished()
        {
            
        }

        public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            //  Create the form.
            NewSecurableWebFormForm form = new NewSecurableWebFormForm();

            //  Show the form.
            form.ShowDialog();

            //  Add the options to the replacementsDictionary.
            replacementsDictionary.Add("$PageTitle$", form.PageTitle);
            replacementsDictionary.Add("$PanelTitle$", form.PanelTitle);
            replacementsDictionary.Add("$AuthorizableItemGuid$", Guid.NewGuid().ToString());
        }

        public bool ShouldAddProjectItem(string filePath)
        {
            return true;
        }
    }
}
